package com.yunyike.controller.weixin;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yunyike.constants.ResponseConstant;
import com.yunyike.constants.WXConstants;
import com.yunyike.wx.utils.WeiXinUtil;

@Controller
@RequestMapping(value=WXConstants.WX)
public class WXScanController {
private static final Logger log = LoggerFactory.getLogger(WXScanController.class);

	/**
	 * 微信sdk初始化
	 * 微信 扫一扫 
	 * @return
	 */
	@RequestMapping(value=WXConstants.INIT_DATA)
	public String initData(HttpServletRequest request,Model model){
		log.info("wx init data...");
		WeiXinUtil.InitData(request, model);
		log.info("wx init data end.");
		return ResponseConstant.INDEX;

	}
}
